From 3dbb40baaa72eebd01169996bd30cbf73b06e7ee Mon Sep 17 00:00:00 2001
From: Daniel Kolesa <daniel@octaforge.org>
Date: Wed, 6 Apr 2022 01:00:04 +0200
Subject: [PATCH 15/18] libc++: musl locale workarounds

---
 libcxx/include/locale | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/libcxx/include/locale b/libcxx/include/locale
index b01c66d04..a7ca65c92 100644
--- a/libcxx/include/locale
+++ b/libcxx/include/locale
@@ -760,7 +760,11 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
         typename remove_reference<decltype(errno)>::type __save_errno = errno;
         errno = 0;
         char *__p2;
+#if defined(__linux__) && !defined(__GLIBC__)
+        long long __ll = strtoll(__a, &__p2, __base);
+#else
         long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
+#endif
         typename remove_reference<decltype(errno)>::type __current_errno = errno;
         if (__current_errno == 0)
             errno = __save_errno;
@@ -800,7 +804,11 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
         typename remove_reference<decltype(errno)>::type __save_errno = errno;
         errno = 0;
         char *__p2;
+#if defined(__linux__) && !defined(__GLIBC__)
+        unsigned long long __ll = strtoull(__a, &__p2, __base);
+#else
         unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
+#endif
         typename remove_reference<decltype(errno)>::type __current_errno = errno;
         if (__current_errno == 0)
             errno = __save_errno;
-- 
2.37.3

